﻿#pragma once
#include "../Constants/windowConstants.h"
#include "Windows.h"
#include "Windowsx.h"
#include "TaskTray.h"
#include "Menu.h"

class ZdsjWindow
{
public:
    ZdsjWindow(HWND parent, HINSTANCE hinstance);
    ZdsjWindow(const ZdsjWindow& zdsj_window) = delete;
    ZdsjWindow& operator=(const ZdsjWindow& zdsj_window) = delete;
    ~ZdsjWindow();
    HWND getHwnd();
private:
    // 注册窗口类
    bool registerClass(HINSTANCE hinstance);
    // 创建窗口
    bool createWindow(HINSTANCE hinstance);
    // 计算宽度
    int getWidth(const RECT* rect);
    // 计算高度
    int getHeight(const RECT* rect);
    
    static LRESULT CALLBACK HandelMsgSetUp(HWND handle, UINT msg, WPARAM wParam, LPARAM lParam);
    static LRESULT CALLBACK HandelMsgForward(HWND handle, UINT msg, WPARAM wParam, LPARAM lParam);
    LRESULT CALLBACK HandelMsg(HWND handle, UINT msg, WPARAM wParam, LPARAM lParam);
       
    
    const wchar_t* _windowName = L"SourceObserve";
    const wchar_t* _className = L"SourceObserve";
    HWND _hwnd = NULL;
    RECT* _rect = nullptr;
    TaskTray* _taskTray = nullptr;
    Menu* _menu = nullptr;
};
